package com.dunshan.order.service.impl;

import com.dunshan.order.mapper.UserMapper;
import com.dunshan.order.pojo.User;
import com.dunshan.order.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * @author .dunshan
 * @program: dunshan-pef
 * @description: 用户
 * @date 2021-10-06 12:21:05
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;

    @Autowired
    StringRedisTemplate masterRedisTemplate;

    @Override
    public List<User> selectList() {
        return userMapper.selectList(null);
    }

    @Override
    public HashMap<String, Object> selectHashMap() {
        HashMap<String, Object> map = new HashMap<>();
        map.put("data", masterRedisTemplate.opsForValue().get("key"));
        return map;
    }
}
